package com.kfc.platform.user.domain;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.PersistenceContext;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import com.sun.org.glassfish.gmbal.NameValue;
//@PersistenceContext(unitName="persistenceUnit") 
//@Entity
//@Table(name = "kfc_user")
//@GenericGenerator(name = "user", strategy = "native")
public class InsertUser {
	private static final String USERNAME_STRATEGY = "^(?!_)(?!.*?_$)[a-zA-Z0-9_]+{5,31}$ ";//5-31位用户名，只能包含字母数字和下划线
	private static final String PASSWORD_STRATEGY = "^[a-zA-Z]d{5,15}$"  ;//6-16位字母开头密码，只能包含字符和数字
	private static final String CELLPHONE_STRATEGY ="^((13[0-9])|(15[0-9])|(18[0-9]))\\d{8}$";//手机号13,15,18开头
	private String username;//用户名
	private String password;//密码
	private String password2;//重复密码
	private String email;//邮箱
	private String phonenum;//手机号
	@Column(unique=true,nullable=false)
	@Size(min=6,max=32)
	@NotNull(message="用户名不能为空！")
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhonenum() {
		return phonenum;
	}
	public void setPhonenum(String phonenum) {
		this.phonenum = phonenum;
	}

	public String getPassword2() {
		return password2;
	}
	public void setPassword2(String password2) {
		this.password2 = password2;
	}
}
